package com.xxzuibang.day12.inner;

public class Test {
    public static void main(String[] args) {
        CellPhone cellPhone = new CellPhone();
        cellPhone.alarmclock(new Bell() {
            @Override
            public void alarm() {
                System.out.println("懒猪起床了，，，");
            }
        });
        cellPhone.alarmclock(new Bell() {
            @Override
            public void alarm() {
                System.out.println("兄弟们上课了，，，");
            }
        });
    }
}

interface Bell {
    void alarm();
}

class CellPhone {
    public void alarmclock(Bell bell) {
        bell.alarm();
    }
}